/**
 *Project: jh-framework
 *File: cn.xkshow.framework.web.servlet.CreateValidateImageServlet.java 
 *Author: hardy(admin@xkshow.cn) Copyright
 ****************************************************************
 *   VERSION       DATE            BY       CHANGE/COMMENT
 * --------------------------------------------------------------
 *    1.0        2013-7-4         hardy         create
 ****************************************************************
 *note:
 ***************************************************************/
package cn.xkshow.framework.web.servlet;


import java.io.IOException;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.xkshow.io.image.ValidateCodeHandle;

public class CreateValidateImageServlet extends HttpServlet {
	
	public void init() throws ServletException {
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		ImageIO.write(ValidateCodeHandle.getInstance().creatImage(request, response, 45, 20), "JPEG", response.getOutputStream());
		
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

	public void destroy() {

	}
}
